package Class.Basis.GirlFriends;

public class test {
    public static void main(String[] args) {
        Girls girl1 = new Girls("小张", 19, true, "未知");
        Girls girl2 = new Girls("小丽", 20, true, "睡觉");
        Girls girl3 = new Girls("小李", 18, true, "玩游戏");
        Girls girl4 = new Girls("小孙", 21, true, "羽毛球");

        Girls[] girl = new Girls[4];

        girl[0] = girl1;
        girl[1] = girl2;
        girl[2] = girl3;
        girl[3] = girl4;

        int sumAge = 0;
        double avgAge;

        for (int i = 0; i < girl.length; i++) {
            Girls Girl = girl[i];
            sumAge += Girl.getAge();
        }

        avgAge = (double) sumAge / girl.length;
        System.out.println(avgAge);

        for (int i = 0; i < girl.length; i++) {
            Girls Girl = girl[i];
            if (Girl.getAge() < avgAge) {
                System.out.println(Girl.toString());
            }
        }
    }
}